//
//  UIBarButtonItem+Extension.swift
//  添加视图辅助开发
//
//  Created by 鱼龙之梦 on 15/9/10.
//  Copyright © 2015年 panyanzhi. All rights reserved.
//

import UIKit
extension UIBarButtonItem {
    convenience init(imageName:String,target:AnyObject?,actionName:String?){
        let button = UIButton(imageName: imageName)
        if target != nil && actionName != nil {
            button.addTarget(target, action: Selector(actionName!), forControlEvents: .TouchUpInside)
        }
        self.init(customView:button)
    }
}
